package 虚拟机.类加载;

public class 类加载器 {

    public static void main(String[] args) {
        // 获取 Application ClassLoader
        ClassLoader appClassLoader = 类加载器.class.getClassLoader();
        System.out.println("Application ClassLoader: " + appClassLoader);

        // 获取 Extension ClassLoader
        ClassLoader extClassLoader = appClassLoader.getParent();
        System.out.println("Extension ClassLoader: " + extClassLoader);

        // 获取 Bootstrap ClassLoader
        ClassLoader bootstrapClassLoader = extClassLoader.getParent();
        System.out.println("Bootstrap ClassLoader: " + bootstrapClassLoader);

        // 获取系统类路径
        System.out.println("类路径: " + System.getProperty("java.class.path"));
    }
}
